home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2002 November / SGI IRIX Base Documentation 2002 November.iso / usr / share / catman / p_man / cat3 / X11 / XButtonEvent.z / XButtonEvent
Encoding:
Text File  |  2002-10-03  |  10.4 KB  |  199 lines

  1.  
  2.  
  3.  
  4.      XXXXBBBBuuuuttttttttoooonnnnEEEEvvvveeeennnntttt((((3333XXXX11111111)))) XXXX VVVVeeeerrrrssssiiiioooonnnn 11111111 ((((RRRReeeelllleeeeaaaasssseeee 6666....6666))))  XXXXBBBBuuuuttttttttoooonnnnEEEEvvvveeeennnntttt((((3333XXXX11111111))))
  5.  
  6.  
  7.  
  8.      NNNNAAAAMMMMEEEE
  9.           XButtonEvent, XKeyEvent, XMotionEvent - KeyPress,
  10.           KeyRelease, ButtonPress, ButtonRelease, and MotionNotify
  11.           event structures
  12.  
  13.      SSSSTTTTRRRRUUUUCCCCTTTTUUUURRRREEEESSSS
  14.           The structures for _K_e_y_P_r_e_s_s, _K_e_y_R_e_l_e_a_s_e, _B_u_t_t_o_n_P_r_e_s_s,
  15.           _B_u_t_t_o_n_R_e_l_e_a_s_e, and _M_o_t_i_o_n_N_o_t_i_f_y events contain:
  16.  
  17.           typedef struct {
  18.                int type;                /* ButtonPress or ButtonRelease */
  19.                unsigned long serial;    /* # of last request processed by server */
  20.                Bool send_event;         /* true if this came from a SendEvent request */
  21.                Display *display;        /* Display the event was read from */
  22.                Window window;           /* ``event'' window it is reported relative to */
  23.                Window root;             /* root window that the event occurred on */
  24.                Window subwindow;        /* child window */
  25.                Time time;               /* milliseconds */
  26.                int x, y;                /* pointer x, y coordinates in event window */
  27.                int x_root, y_root;      /* coordinates relative to root */
  28.                unsigned int state;      /* key or button mask */
  29.                unsigned int button;     /* detail */
  30.                Bool same_screen;        /* same screen flag */
  31.           } XButtonEvent;
  32.           typedef XButtonEvent XButtonPressedEvent;
  33.           typedef XButtonEvent XButtonReleasedEvent;
  34.  
  35.           typedef struct {
  36.                int type;                /* KeyPress or KeyRelease */
  37.                unsigned long serial;    /* # of last request processed by server */
  38.                Bool send_event;         /* true if this came from a SendEvent request */
  39.                Display *display;        /* Display the event was read from */
  40.                Window window;           /* ``event'' window it is reported relative to */
  41.                Window root;             /* root window that the event occurred on */
  42.                Window subwindow;        /* child window */
  43.                Time time;               /* milliseconds */
  44.                int x, y;                /* pointer x, y coordinates in event window */
  45.                int x_root, y_root;      /* coordinates relative to root */
  46.                unsigned int state;      /* key or button mask */
  47.                unsigned int keycode;    /* detail */
  48.                Bool same_screen;        /* same screen flag */
  49.           } XKeyEvent;
  50.           typedef XKeyEvent XKeyPressedEvent;
  51.           typedef XKeyEvent XKeyReleasedEvent;
  52.  
  53.           typedef struct {
  54.                int type;                /* MotionNotify */
  55.                unsigned long serial;    /* # of last request processed by server */
  56.                Bool send_event;         /* true if this came from a SendEvent request */
  57.                Display *display;        /* Display the event was read from */
  58.                Window window;           /* ``event'' window reported relative to */
  59.                Window root;             /* root window that the event occurred on */
  60.  
  61.  
  62.  
  63.      Page 1                                          (printed 10/3/02)
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.      XXXXBBBBuuuuttttttttoooonnnnEEEEvvvveeeennnntttt((((3333XXXX11111111)))) XXXX VVVVeeeerrrrssssiiiioooonnnn 11111111 ((((RRRReeeelllleeeeaaaasssseeee 6666....6666))))  XXXXBBBBuuuuttttttttoooonnnnEEEEvvvveeeennnntttt((((3333XXXX11111111))))
  71.  
  72.  
  73.  
  74.                Window subwindow;        /* child window */
  75.                Time time;               /* milliseconds */
  76.                int x, y;                /* pointer x, y coordinates in event window */
  77.                int x_root, y_root;      /* coordinates relative to root */
  78.                unsigned int state;      /* key or button mask */
  79.                char is_hint;            /* detail */
  80.                Bool same_screen;        /* same screen flag */
  81.           } XMotionEvent;
  82.           typedef XMotionEvent XPointerMovedEvent;
  83.  
  84.           When you receive these events, their structure members are
  85.           set as follows.
  86.  
  87.           The type member is set to the event type constant name that
  88.           uniquely identifies it.  For example, when the X server
  89.           reports a _G_r_a_p_h_i_c_s_E_x_p_o_s_e event to a client application, it
  90.           sends an _X_G_r_a_p_h_i_c_s_E_x_p_o_s_e_E_v_e_n_t structure with the type member
  91.           set to _G_r_a_p_h_i_c_s_E_x_p_o_s_e.  The display member is set to a
  92.           pointer to the display the event was read on.  The
  93.           send_event member is set to _T_r_u_e if the event came from a
  94.           _S_e_n_d_E_v_e_n_t protocol request.  The serial member is set from
  95.           the serial number reported in the protocol but expanded from
  96.           the 16-bit least-significant bits to a full 32-bit value.
  97.           The window member is set to the window that is most useful
  98.           to toolkit dispatchers.
  99.  
  100.           These structures have the following common members:  window,
  101.           root, subwindow, time, x, y, x_root, y_root, state, and
  102.           same_screen.  The window member is set to the window on
  103.           which the event was generated and is referred to as the
  104.           event window. As long as the conditions previously discussed
  105.           are met, this is the window used by the X server to report
  106.           the event.  The root member is set to the source window's
  107.           root window.  The x_root and y_root members are set to the
  108.           pointer's coordinates relative to the root window's origin
  109.           at the time of the event.
  110.  
  111.           The same_screen member is set to indicate whether the event
  112.           window is on the same screen as the root window and can be
  113.           either _T_r_u_e or _F_a_l_s_e.  If _T_r_u_e, the event and root windows
  114.           are on the same screen.  If _F_a_l_s_e, the event and root
  115.           windows are not on the same screen.
  116.  
  117.           If the source window is an inferior of the event window, the
  118.           subwindow member of the structure is set to the child of the
  119.           event window that is the source window or the child of the
  120.           event window that is an ancestor of the source window.
  121.           Otherwise, the X server sets the subwindow member to _N_o_n_e.
  122.           The time member is set to the time when the event was
  123.           generated and is expressed in milliseconds.
  124.  
  125.           If the event window is on the same screen as the root
  126.  
  127.  
  128.  
  129.      Page 2                                          (printed 10/3/02)
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.      XXXXBBBBuuuuttttttttoooonnnnEEEEvvvveeeennnntttt((((3333XXXX11111111)))) XXXX VVVVeeeerrrrssssiiiioooonnnn 11111111 ((((RRRReeeelllleeeeaaaasssseeee 6666....6666))))  XXXXBBBBuuuuttttttttoooonnnnEEEEvvvveeeennnntttt((((3333XXXX11111111))))
  137.  
  138.  
  139.  
  140.           window, the x and y members are set to the coordinates
  141.           relative to the event window's origin.  Otherwise, these
  142.           members are set to zero.
  143.  
  144.           The state member is set to indicate the logical state of the
  145.           pointer buttons and modifier keys just prior to the event,
  146.           which is the bitwise inclusive OR of one or more of the
  147.           button or modifier key masks:  _B_u_t_t_o_n_1_M_a_s_k, _B_u_t_t_o_n_2_M_a_s_k,
  148.           _B_u_t_t_o_n_3_M_a_s_k, _B_u_t_t_o_n_4_M_a_s_k, _B_u_t_t_o_n_5_M_a_s_k, _S_h_i_f_t_M_a_s_k, _L_o_c_k_M_a_s_k,
  149.           _C_o_n_t_r_o_l_M_a_s_k, _M_o_d_1_M_a_s_k, _M_o_d_2_M_a_s_k, _M_o_d_3_M_a_s_k, _M_o_d_4_M_a_s_k, and
  150.           _M_o_d_5_M_a_s_k.
  151.  
  152.           Each of these structures also has a member that indicates
  153.           the detail.  For the _X_K_e_y_P_r_e_s_s_e_d_E_v_e_n_t and _X_K_e_y_R_e_l_e_a_s_e_d_E_v_e_n_t
  154.           structures, this member is called a keycode.  It is set to a
  155.           number that represents a physical key on the keyboard.  The
  156.           keycode is an arbitrary representation for any key on the
  157.           keyboard (see sections 12.7 and 16.1).
  158.  
  159.           For the _X_B_u_t_t_o_n_P_r_e_s_s_e_d_E_v_e_n_t and _X_B_u_t_t_o_n_R_e_l_e_a_s_e_d_E_v_e_n_t
  160.           structures, this member is called button.  It represents the
  161.           pointer button that changed state and can be the _B_u_t_t_o_n_1,
  162.           _B_u_t_t_o_n_2, _B_u_t_t_o_n_3, _B_u_t_t_o_n_4, or _B_u_t_t_o_n_5 value.  For the
  163.           _X_P_o_i_n_t_e_r_M_o_v_e_d_E_v_e_n_t structure, this member is called is_hint.
  164.           It can be set to _N_o_t_i_f_y_N_o_r_m_a_l or _N_o_t_i_f_y_H_i_n_t.
  165.  
  166.      SSSSEEEEEEEE AAAALLLLSSSSOOOO
  167.           XAnyEvent(3X11), XCreateWindowEvent(3X11),
  168.           XCirculateEvent(3X11), XCirculateRequestEvent(3X11),
  169.           XColormapEvent(3X11), XConfigureEvent(3X11),
  170.           XConfigureRequestEvent(3X11), XCrossingEvent(3X11),
  171.           XDestroyWindowEvent(3X11), XErrorEvent(3X11),
  172.           XExposeEvent(3X11), XFocusChangeEvent(3X11),
  173.           XGraphicsExposeEvent(3X11), XGravityEvent(3X11),
  174.           XKeymapEvent(3X11), XMapEvent(3X11), XMapRequestEvent(3X11),
  175.           XPropertyEvent(3X11), XReparentEvent(3X11),
  176.           XResizeRequestEvent(3X11), XSelectionClearEvent(3X11),
  177.           XSelectionEvent(3X11), XSelectionRequestEvent(3X11),
  178.           XUnmapEvent(3X11), XVisibilityEvent(3X11)
  179.           _X_l_i_b - _C _L_a_n_g_u_a_g_e _X _I_n_t_e_r_f_a_c_e
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.      Page 3                                          (printed 10/3/02)
  196.  
  197.  
  198.  
  199.